package com.example.dts.model;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.UUID;

@Entity
@Table(name = "permission")
@Data
@ToString(callSuper = true)
@DynamicInsert
@DynamicUpdate
@NoArgsConstructor
public class Permission extends BaseEntity implements Serializable {

    @Id
    @GenericGenerator(name = "uuidG", strategy = "org.hibernate.id.UUIDGenerator")
    @GeneratedValue(generator = "uuidG")
    @Column(name = "id", length = 50)
    private String id;

    @Column(name = "name")
    private String name;

    @Column(name = "description")
    private String description;

    public static void main(String[] args) {
        System.out.println(UUID.randomUUID());
    }
}
